package com.bedrock.project.inside.mapper;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.bedrock.project.inside.entity.InterviewerFlow;
import com.bedrock.project.inside.entity.RecruitEntity;
import com.bedrock.project.inside.vo.response.InterviewEmailVo;

/**
 * 招聘Mapper接口
 *
 * @author bedrock
 * @date 2020-04-07
 */
@Mapper
public interface RecruitMapper {
    /**
     * 查询招聘
     *
     * @param id 招聘ID
     * @return 招聘
     */
    public RecruitEntity selectRecruitEntityById(Long id);

    /**
     * 查询招聘列表
     *
     * @param recruitEntity 招聘
     * @return 招聘集合
     */
    public List<RecruitEntity> selectRecruitEntityList(RecruitEntity recruitEntity);

    /**
     * 新增招聘
     *
     * @param recruitEntity 招聘
     * @return 结果
     */
    public int insertRecruitEntity(RecruitEntity recruitEntity);

    /**
     * 修改招聘
     *
     * @param recruitEntity 招聘
     * @return 结果
     */
    public int updateRecruitEntity(RecruitEntity recruitEntity);

    /**
     * 删除招聘
     *
     * @param id 招聘ID
     * @return 结果
     */
    public int deleteRecruitEntityById(Long id);

    /**
     * 批量删除招聘
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteRecruitEntityByIds(Long[] ids);

    /**
     * 修改面试的流程
     *
     * @param InterviewerFlow
     */
    public void insertRecruitFlow(InterviewerFlow InterviewerFlow);

    /**
     * 待办处理查询
     *
     * @param recruitEntity
     * @return
     */
    public List<RecruitEntity> selectRecruitWaitDo(RecruitEntity recruitEntity);

    /**
     * 修改求职者的面试官
     *
     * @param recruitEntity
     */
    public void updateDoUserId(RecruitEntity recruitEntity);

    /**
     * 查询流程信息
     *
     * @param id
     * @return
     */
    public InterviewerFlow findFlowById(@Param("id") Long id);

    /**
     * 修改流程
     *
     * @param flow
     */
    public void updateFlowById(InterviewerFlow flow) throws SQLException;


    /**
     * 修改求职者表的状态
     *
     * @param jobberStatic 求职者面试状态
     * @param id
     * @param isEntry      是否入职
     * @param makeTime     预约时间
     * @param jobRemark    面试评语
     * @param chooseRemark 筛选评语
     * @throws SQLException
     */
    public void updateRectuitStatic(@Param("jobberStatic") Integer jobberStatic,
                                    @Param("id") Long id,
                                    @Param("isEntry") Integer isEntry,
                                    @Param("makeTime") String makeTime,
                                    @Param("jobRemark") String jobRemark,
                                    @Param("chooseRemark") String chooseRemark) throws SQLException;


    /**
     * 修改求职者的简历
     *
     * @param vitaeUrl
     * @param id
     * @param createBy
     * @throws SQLException
     */
    public void updateVitaeUrl(@Param("map") Map map) throws SQLException;

    /**
     *
     * @return
     */
    List<InterviewEmailVo> sumWeeklyInterView();


}
